<?php

namespace app\admin\model;
use think\model\concern\SoftDelete;
use think\Model;

class GoodsModel extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;
    // 设置当前模型对应的完整数据表名称
    protected $name = 'goods';
    //定义主键
    protected $pk = 'id';

    // 设置json类型字段
    protected $json = ['specs', 'goods_carousel'];
    
    public function cate()
    {
        return $this->belongsTo('CateModel');
    }
}
